package com.medusa.aps.business.modules.plan.controller;


import com.medusa.aps.business.model.pagination.Page;
import com.medusa.aps.business.modules.plan.model.input.ProcessDetailsParam;
import com.medusa.aps.business.modules.plan.model.output.ProcessDetailsVO;
import com.medusa.aps.business.modules.plan.mp.service.ProcessDetailsService;
import com.medusa.aps.business.util.PercentageScheduleUtils;
import com.medusa.aps.business.common.model.resp.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * 工序明细控制层
 *
 * @author yuxh
 * @since 2023-08-14 17:37:48
 */
@Slf4j
@RestController
@RequestMapping("/process/details")
@Tag(name = "工序明细控制层", description = "工序明细控制层")
public class ProcessDetailsController {
    /**
     * 服务对象
     */
    @Resource
    private ProcessDetailsService processDetailsService;

    /**
     * 分页查询所有数据
     *
     * @param processDetails 查询实体
     * @return 所有数据
     */
    @GetMapping("/select/page")
    @Operation(description = "分页查询所有数据", summary = "分页查询所有数据")
    public Result<Page<ProcessDetailsVO>> selectPage(@Parameter(description = "查询参数") ProcessDetailsParam processDetails) {
        return Result.ok(processDetailsService.selectPage(new Page<>(processDetails.getCurrent(), processDetails.getSize()), processDetails));
    }
}

